package com.ruoyi.agriculture.guo.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.agriculture.guo.mapper.AgriConversationMapper;
import com.ruoyi.agriculture.guo.domain.AgriConversation;
import com.ruoyi.agriculture.guo.service.IAgriConversationService;

/**
 * 农业问答会话Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-07-31
 */
@Service
public class AgriConversationServiceImpl implements IAgriConversationService 
{
    @Autowired
    private AgriConversationMapper agriConversationMapper;

    /**
     * 查询农业问答会话
     * 
     * @param id 农业问答会话主键
     * @return 农业问答会话
     */
    @Override
    public AgriConversation selectAgriConversationById(Long id)
    {
        return agriConversationMapper.selectAgriConversationById(id);
    }

    /**
     * 查询农业问答会话列表
     * 
     * @param agriConversation 农业问答会话
     * @return 农业问答会话
     */
    @Override
    public List<AgriConversation> selectAgriConversationList(AgriConversation agriConversation)
    {
        return agriConversationMapper.selectAgriConversationList(agriConversation);
    }

    /**
     * 新增农业问答会话
     * 
     * @param agriConversation 农业问答会话
     * @return 结果
     */
    @Override
    public int insertAgriConversation(AgriConversation agriConversation)
    {
        agriConversation.setCreateTime(DateUtils.getNowDate());
        return agriConversationMapper.insertAgriConversation(agriConversation);
    }

    /**
     * 修改农业问答会话
     * 
     * @param agriConversation 农业问答会话
     * @return 结果
     */
    @Override
    public int updateAgriConversation(AgriConversation agriConversation)
    {
        agriConversation.setUpdateTime(DateUtils.getNowDate());
        return agriConversationMapper.updateAgriConversation(agriConversation);
    }

    /**
     * 批量删除农业问答会话
     * 
     * @param ids 需要删除的农业问答会话主键
     * @return 结果
     */
    @Override
    public int deleteAgriConversationByIds(Long[] ids)
    {
        return agriConversationMapper.deleteAgriConversationByIds(ids);
    }

    /**
     * 删除农业问答会话信息
     * 
     * @param id 农业问答会话主键
     * @return 结果
     */
    @Override
    public int deleteAgriConversationById(Long id)
    {
        return agriConversationMapper.deleteAgriConversationById(id);
    }
}
